<template>
  <div class="opration">
    <div class="oprationLeft">
      <bs-add-button-icon @click.native="addClick" v-has="'MEDIA_SCHEDULE_SAVE'"></bs-add-button-icon>
      <bs-delete-button-icon @click.native="deleteClick" v-has="'MEDIA_SCHEDULE_DELETE'"></bs-delete-button-icon>
      <bs-revoke-button-icon @click.native="revokeClick" v-has="'MEDIA_SCHEDULE_UPDATE'"></bs-revoke-button-icon>
      <bs-edit-button-icon @click.native="editClick" v-has="'MEDIA_SCHEDULE_UPDATE'"></bs-edit-button-icon>
      <bs-examine-button-icon @click.native="examineClick" v-if="isScheduleAudit"></bs-examine-button-icon>
      <bs-refresh-button-icon @click.native="refreshClick"></bs-refresh-button-icon>
      <slot name="export"></slot>
    </div>
  </div>
</template>
<script>
export default {
  name: 'ConditionRow',
  data() {
    return {
    }
  },
  computed: {
    isScheduleAudit() {
      if(
        this.$checkOperationPermission('MEDIA_SCHEDULE_AUDIT_ONE') ||
        this.$checkOperationPermission('MEDIA_SCHEDULE_AUDIT_TWO') ||
        this.$checkOperationPermission('MEDIA_SCHEDULE_AUDIT_THREE')
      ) {
        return true
      }
      return false
    }
  },
  methods: {
    addClick() {
      this.$emit('add')
    },
    deleteClick() {
      this.$emit('del')
    },
    revokeClick() {
      this.$emit('revoke')
    },
    editClick() {
      this.$emit('edit')
    },
    examineClick() {
      this.$emit('examine')
    },
    refreshClick() {
      this.$emit('refresh')
    },
    exportClick() {

    }
  },
}
</script>
<style lang="scss" scoped>
.export-excel-wrapper{
  display: inline-block;
  width: 64px;
  margin-right: 8px;
}
</style>